package com.hzeport.bgs22emduty.util;

/**
 * @author zhangyangyang
 * @description
 * @date 2023/8/21 16:00
 */

/**
 * <script>
 *         //    ——————————————————————————————————START浙江省政务网地图相关加签工作START——————————————————————————————————
 *         //和普通base64加密不一样
 *         function base64UrlEncode(str) {
 *             var encodedSource = CryptoJS.enc.Base64.stringify(str);
 *             var reg = new RegExp('/', 'g');
 *             encodedSource = encodedSource.replace(/=+$/, '').replace(/\+/g, '-').replace(reg, '_');
 *             return encodedSource;
 *         }
 *
 *         function createZJSign()
 *         {
 *             let accessKey = "BCDSGA_8776724c320292291cc43d183237398a";   //修改自己申请的accessKey，ak、sk不要弄反
 *             let secretKey = "BCDSGS_675e726782e5dbfd1e24b834ea17ec0c";   //修改自己申请的secretKey，ak、sk不要弄反
 *
 *             let header = JSON.stringify({
 *                 "alg": "HS256",
 *                 "typ": "JWT"
 *             });
 *             //ak、sk和生成token建议在后端，避免前端调用的时候泄露
 *             let payload = JSON.stringify({
 *                 "key": accessKey,
 *                 "exp": new Date().setHours(new Date().getHours()+1)
 *             });
 *
 *             let secretSalt = "user";
 *
 *             let before_sign = base64UrlEncode(CryptoJS.enc.Utf8.parse(header)) + '.' + base64UrlEncode(CryptoJS.enc.Utf8.parse(payload));
 *             let signature = CryptoJS.HmacSHA256(before_sign, secretKey);
 *             signature = base64UrlEncode(signature);
 *             let final_sign = before_sign + '.' + signature;
 *
 *             console.log(final_sign)
 *
 *             return final_sign;
 *         }
 *
 *         function doXHR()
 *         {
 *             let final_sign=createZJSign();
 *             let divRep=document.getElementById('divRep');
 *             const weatherUrl = 'https://10.73.1.66:9091/api/zjgov/restapi/prod/IC33000020230526000001/api'
 *             const requestUrl = weatherUrl+'?jwt='+final_sign+'&x-bg-auth-type=jwt_auth&province=浙江'// 请求地址
 *             var xhr=new XMLHttpRequest();
 *             //xhr.open('post','http://10.73.13.221:8081/jpcManageScreen/jpcScreenWarning/screenNode',false);
 *             xhr.open('GET',requestUrl);
 *             //xhr.setRequestHeader('Content-Type','application/json');
 *             //xhr.send(JSON.stringify(sendData));
 *             xhr.send();
 *             xhr.onreadystatechange=function(){
 *                 if(xhr.status===200)
 *                 {
 *                     //let res=JSON.parse(xhr.responseText)
 *                     //console.log(res.data);
 *                     console.log(xhr.response);
 *                     console.log(xhr.responseText);
 *                     document.getElementById('divRep').innerText=xhr.responseText;
 *                 }
 *                 else
 *                 {
 *                     console.log('Erro:'+xhr.status);
 *                 }
 *             }
 *         }
 *
 *         doXHR();
 *     </script>
 */
public class WeatherUtil {



}
